import serves from './axios'
import store from '@/store/index'

// 优势

// 获取优势列表
export function getAdvantageList() {
    return serves({
        url: '/admin/getAdvantageList',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}

// 获取优势详情
export function getAdvantageInfo(id) {
    return serves({
        url: '/admin/getAdvantageInfo',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 新增优势
export function addAdvantage(data) {
    return serves({
        url: '/admin/addAdvantage',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 删除优势
export function delAdvantage(id) {
    return serves({
        url: '/admin/delAdvantage',
        method: 'post',
        data: {
            token: store.state.token,
            id
        }
    })
}

// 修改优势
export function updateAdvantage(data) {
    return serves({
        url: '/admin/updateAdvantage',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}